import { config } from "./config"
/* 封装wx.request */
export const request_netEase = (url, data = {}, method='get') => {
  return new Promise((resolve, reject) => {
    wx.request({
        url:`${config.host2}/${url}`,
        method,
        data,
        // enableCache: true,
        success: res => {
            resolve(res.data)
        },
        fail: err => {
          console.log('出错啦')
            reject({
              err,
              msg:'请求错误'
            })
        }
    }
    )
  })
}
